using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using Webcam_Filter;

namespace Webcam_application
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
        public int numberOfTimesFiltered = 0;
        public DateTime firstFilterTime = DateTime.Now;
        private Filter actieveFilter = new GeenFilter();// GeenFilter();
        private string[] huidigeArgs = new String[0];
        private System.Windows.Forms.PictureBox pictureBox1;
        private Button button1;
        private Button button2;
        private Button button3;
        private Button button4;
        private Label label1;
        private Button button5;
        private Button button6;
        private Button button7;
        private Button button8;
        private Button button10;
        private Button button11;
        private Label label2;
        private WebCam_Capture.WebCamCapture WebCamCapture;
        private TableLayoutPanel tableLayoutPanel1;
        private Button button12;
        private Button button9;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Form1()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

            // change the capture time frame
            this.WebCamCapture.TimeToCapture_milliseconds = 5;

            // start the video capture. let the control handle the
            // frame numbers.
            this.WebCamCapture.Start(0);
            //DEFAULT TEXT PARAMETER VELD
            this.huidigeArgs = new string[0];
            Label labelGeenProperties = new Label();
            labelGeenProperties.Text = "Geen parameters beschikbaar";
            labelGeenProperties.Width = tableLayoutPanel1.Width;
            this.tableLayoutPanel1.Controls.Add(labelGeenProperties);
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.button3 = new System.Windows.Forms.Button();
            this.button4 = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.button5 = new System.Windows.Forms.Button();
            this.button6 = new System.Windows.Forms.Button();
            this.button7 = new System.Windows.Forms.Button();
            this.button8 = new System.Windows.Forms.Button();
            this.button10 = new System.Windows.Forms.Button();
            this.button11 = new System.Windows.Forms.Button();
            this.label2 = new System.Windows.Forms.Label();
            this.WebCamCapture = new WebCam_Capture.WebCamCapture();
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.button12 = new System.Windows.Forms.Button();
            this.button9 = new System.Windows.Forms.Button();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.SuspendLayout();
            // 
            // pictureBox1
            // 
            this.pictureBox1.Location = new System.Drawing.Point(125, 36);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(768, 576);
            this.pictureBox1.TabIndex = 0;
            this.pictureBox1.TabStop = false;
            // 
            // button1
            // 
            this.button1.BackColor = System.Drawing.Color.DarkGray;
            this.button1.Location = new System.Drawing.Point(116, 680);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(86, 35);
            this.button1.TabIndex = 1;
            this.button1.Text = "Reset";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // button2
            // 
            this.button2.BackColor = System.Drawing.Color.DarkGray;
            this.button2.Location = new System.Drawing.Point(394, 659);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(75, 23);
            this.button2.TabIndex = 2;
            this.button2.Text = "Storm";
            this.button2.UseVisualStyleBackColor = false;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            // 
            // button3
            // 
            this.button3.BackColor = System.Drawing.Color.DarkGray;
            this.button3.ForeColor = System.Drawing.SystemColors.WindowText;
            this.button3.Location = new System.Drawing.Point(536, 659);
            this.button3.Name = "button3";
            this.button3.Size = new System.Drawing.Size(75, 23);
            this.button3.TabIndex = 3;
            this.button3.Text = "Pixelator";
            this.button3.UseVisualStyleBackColor = false;
            this.button3.Click += new System.EventHandler(this.button3_Click);
            // 
            // button4
            // 
            this.button4.BackColor = System.Drawing.Color.DarkGray;
            this.button4.Location = new System.Drawing.Point(670, 659);
            this.button4.Name = "button4";
            this.button4.Size = new System.Drawing.Size(88, 23);
            this.button4.TabIndex = 4;
            this.button4.Text = "Spiegelfilter";
            this.button4.UseVisualStyleBackColor = false;
            this.button4.Click += new System.EventHandler(this.button4_Click);
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.BackColor = System.Drawing.Color.LightGray;
            this.label1.Location = new System.Drawing.Point(12, 9);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(35, 13);
            this.label1.TabIndex = 7;
            this.label1.Text = "label1";
            // 
            // button5
            // 
            this.button5.BackColor = System.Drawing.Color.DarkGray;
            this.button5.Location = new System.Drawing.Point(251, 659);
            this.button5.Name = "button5";
            this.button5.Size = new System.Drawing.Size(75, 23);
            this.button5.TabIndex = 9;
            this.button5.Text = "Histogram";
            this.button5.UseVisualStyleBackColor = false;
            this.button5.Click += new System.EventHandler(this.button5_Click);
            // 
            // button6
            // 
            this.button6.BackColor = System.Drawing.Color.DarkGray;
            this.button6.Location = new System.Drawing.Point(803, 659);
            this.button6.Name = "button6";
            this.button6.Size = new System.Drawing.Size(88, 23);
            this.button6.TabIndex = 10;
            this.button6.Text = "Cirkelfilter";
            this.button6.UseVisualStyleBackColor = false;
            this.button6.Click += new System.EventHandler(this.button6_Click);
            // 
            // button7
            // 
            this.button7.BackColor = System.Drawing.Color.DarkGray;
            this.button7.Location = new System.Drawing.Point(670, 716);
            this.button7.Name = "button7";
            this.button7.Size = new System.Drawing.Size(88, 23);
            this.button7.TabIndex = 11;
            this.button7.Text = "Visbokaal";
            this.button7.UseVisualStyleBackColor = false;
            this.button7.Click += new System.EventHandler(this.button7_Click);
            // 
            // button8
            // 
            this.button8.BackColor = System.Drawing.Color.DarkGray;
            this.button8.Location = new System.Drawing.Point(251, 716);
            this.button8.Name = "button8";
            this.button8.Size = new System.Drawing.Size(75, 23);
            this.button8.TabIndex = 12;
            this.button8.Text = "Oude foto";
            this.button8.UseVisualStyleBackColor = false;
            this.button8.Click += new System.EventHandler(this.button8_Click);
            // 
            // button10
            // 
            this.button10.BackColor = System.Drawing.Color.DarkGray;
            this.button10.Location = new System.Drawing.Point(536, 716);
            this.button10.Name = "button10";
            this.button10.Size = new System.Drawing.Size(75, 23);
            this.button10.TabIndex = 14;
            this.button10.Text = "Bluescreen";
            this.button10.UseVisualStyleBackColor = false;
            this.button10.Click += new System.EventHandler(this.button10_Click);
            // 
            // button11
            // 
            this.button11.BackColor = System.Drawing.Color.DarkGray;
            this.button11.Location = new System.Drawing.Point(394, 716);
            this.button11.Name = "button11";
            this.button11.Size = new System.Drawing.Size(75, 23);
            this.button11.TabIndex = 15;
            this.button11.Text = "Oude film";
            this.button11.UseVisualStyleBackColor = false;
            this.button11.Click += new System.EventHandler(this.button11_Click);
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.BackColor = System.Drawing.Color.Black;
            this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.ForeColor = System.Drawing.SystemColors.Menu;
            this.label2.Location = new System.Drawing.Point(1097, 36);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(91, 20);
            this.label2.TabIndex = 17;
            this.label2.Text = "Parameters";
            // 
            // WebCamCapture
            // 
            this.WebCamCapture.CaptureHeight = 240;
            this.WebCamCapture.CaptureWidth = 320;
            this.WebCamCapture.FrameNumber = ((ulong)(0ul));
            this.WebCamCapture.Location = new System.Drawing.Point(17, 17);
            this.WebCamCapture.Name = "WebCamCapture";
            this.WebCamCapture.Size = new System.Drawing.Size(342, 252);
            this.WebCamCapture.TabIndex = 0;
            this.WebCamCapture.TimeToCapture_milliseconds = 100;
            this.WebCamCapture.ImageCaptured += new WebCam_Capture.WebCamCapture.WebCamEventHandler(this.WebCamCapture_ImageCaptured);
            // 
            // tableLayoutPanel1
            // 
            this.tableLayoutPanel1.ColumnCount = 1;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tableLayoutPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tableLayoutPanel1.ForeColor = System.Drawing.SystemColors.Control;
            this.tableLayoutPanel1.Location = new System.Drawing.Point(943, 87);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 10;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 51.51515F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 48.48485F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 43F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 41F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 41F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 38F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 39F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 38F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 49F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(374, 429);
            this.tableLayoutPanel1.TabIndex = 18;
            // 
            // button12
            // 
            this.button12.BackColor = System.Drawing.Color.DarkGray;
            this.button12.Location = new System.Drawing.Point(803, 716);
            this.button12.Name = "button12";
            this.button12.Size = new System.Drawing.Size(88, 23);
            this.button12.TabIndex = 19;
            this.button12.Text = "Randen";
            this.button12.UseVisualStyleBackColor = false;
            this.button12.Click += new System.EventHandler(this.button12_Click);
            // 
            // button9
            // 
            this.button9.BackColor = System.Drawing.Color.DarkGray;
            this.button9.Location = new System.Drawing.Point(953, 659);
            this.button9.Name = "button9";
            this.button9.Size = new System.Drawing.Size(88, 23);
            this.button9.TabIndex = 20;
            this.button9.Text = "Fluo";
            this.button9.UseVisualStyleBackColor = false;
            this.button9.Click += new System.EventHandler(this.button9_Click_1);
            // 
            // Form1
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.BackColor = System.Drawing.Color.Black;
            this.ClientSize = new System.Drawing.Size(1345, 774);
            this.Controls.Add(this.button9);
            this.Controls.Add(this.button12);
            this.Controls.Add(this.tableLayoutPanel1);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.button11);
            this.Controls.Add(this.button10);
            this.Controls.Add(this.button8);
            this.Controls.Add(this.button7);
            this.Controls.Add(this.button6);
            this.Controls.Add(this.button5);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.button4);
            this.Controls.Add(this.button3);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.pictureBox1);
            this.Name = "Form1";
            this.Text = "Webcam-filter application";
            this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing);
            this.Load += new System.EventHandler(this.Form1_Load);
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());
		}

		private void Form1_Load(object sender, System.EventArgs e)
		{
			// set the image capture size
			this.WebCamCapture.CaptureHeight = this.pictureBox1.Height;
			this.WebCamCapture.CaptureWidth = this.pictureBox1.Width;
		}

		private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
			// stop the video capture
			this.WebCamCapture.Stop();
		}

		/// <summary>
		/// An image was captured
		/// </summary>
		/// <param name="source">control raising the event</param>
		/// <param name="e">WebCamEventArgs</param>
		private void WebCamCapture_ImageCaptured(object source, WebCam_Capture.WebcamEventArgs e)
		{
            System.Drawing.Bitmap bmshape = ((Bitmap) e.WebCamImage);
            actieveFilter.filter(bmshape, huidigeArgs);
            this.pictureBox1.Image = e.WebCamImage;
            int timepassed = ((DateTime.Now.Subtract(this.firstFilterTime)).Seconds);
            if(timepassed!=0)//division by zero tegengaan...
                this.label1.Text = "FPS: " + this.numberOfTimesFiltered / timepassed + " Frames totaal: " + this.numberOfTimesFiltered + ", time passed " + timepassed; 
            this.numberOfTimesFiltered++;
		}

        private void button1_Click(object sender, EventArgs e) //GEEN FILTER 
        {
            filterChange();
            this.actieveFilter = new GeenFilter();
            this.huidigeArgs = new string[0];
            Label labelGeenProperties = new Label();
            labelGeenProperties.Text = "Geen parameters beschikbaar";
            labelGeenProperties.Width = tableLayoutPanel1.Width;
            this.tableLayoutPanel1.Controls.Add(labelGeenProperties);
        }
///////////////////STORM FILTER//////////////////////////////////////////////////////////
        private void button2_Click(object sender, EventArgs e) 
        {
            filterChange();
            this.actieveFilter = new  StormFilter();
            this.huidigeArgs = new string[2];

            Label labelSoort = new Label();
            labelSoort.Text = "Soort storm";
            labelSoort.Width = this.tableLayoutPanel1.Width;
            this.tableLayoutPanel1.Controls.Add(labelSoort);

            ComboBox soortBox = new ComboBox();   
            soortBox.Items.Add("sneeuw");
            soortBox.Items.Add("zand");
            soortBox.Items.Add("regen");
            soortBox.SelectedItem = soortBox.Items[0];
            this.huidigeArgs[1] = "sneeuw";
            soortBox.SelectedValueChanged += new EventHandler(soortBox_SelectedValueChanged);
            this.tableLayoutPanel1.Controls.Add(soortBox);
            

            Label labelIntensiteitStorm = new Label();
            labelIntensiteitStorm.Text = "Intensiteit";
            labelIntensiteitStorm.Width = this.tableLayoutPanel1.Width;
            this.tableLayoutPanel1.Controls.Add(labelIntensiteitStorm);
            this.huidigeArgs[0] = "1";
            HScrollBar pixelGrootteBar = new HScrollBar();
            pixelGrootteBar.Width = 200;
            pixelGrootteBar.Scroll += new ScrollEventHandler(stormFilterIntensiteit_Scroll);
            this.tableLayoutPanel1.Controls.Add(pixelGrootteBar);
        }
        void soortBox_SelectedValueChanged(object sender, EventArgs e)
        {
            this.huidigeArgs[1] = ""+((ComboBox)sender).SelectedItem;
        }
        void stormFilterIntensiteit_Scroll(object sender, ScrollEventArgs e)
        {
            this.huidigeArgs[0] = "" + e.NewValue;
        }
////////////////////////////////////////////////////////////////////////////////////


/////////////////////PIXELATOR FILTER///////////////////////////////////////////////
        private void button3_Click(object sender, EventArgs e) 
        {
            filterChange();
            this.actieveFilter = new PixelatorFilter();
            this.huidigeArgs = new string[1];

            Label labelPixelGrootte = new Label();
            labelPixelGrootte.Text = "Pixel grootte";
            labelPixelGrootte.Width = this.tableLayoutPanel1.Width;
            this.tableLayoutPanel1.Controls.Add(labelPixelGrootte);

            HScrollBar pixelGrootteBar = new HScrollBar();
            pixelGrootteBar.Width = 200;
            pixelGrootteBar.Scroll += new ScrollEventHandler(pixelatorFilterPixelGrootteBar_Scroll);
            this.tableLayoutPanel1.Controls.Add(pixelGrootteBar);
        }

        void pixelatorFilterPixelGrootteBar_Scroll(object sender, ScrollEventArgs e)
        {
            this.huidigeArgs[0] = ""+e.NewValue;
        }
///////////////////////////////////////////////////////////////////

////////////////////////////////////////////SPIEGELFILTER//////////////////////////////////////
        private void button4_Click(object sender, EventArgs e) 
        {
            filterChange();
            this.actieveFilter = new SpiegelFilter();
            Label labelGeenProperties = new Label();
            labelGeenProperties.Text = "Geen parameters beschikbaar";
            labelGeenProperties.Width = tableLayoutPanel1.Width;
            this.tableLayoutPanel1.Controls.Add(labelGeenProperties);
        }

  
        private void filterChange()
        {
            this.firstFilterTime = DateTime.Now;
            this.numberOfTimesFiltered = 0;

            this.tableLayoutPanel1.Controls.Clear();
        }

        private void button8_Click(object sender, EventArgs e) //OUDE FOTO FILTER KOEN HIER
        {
            filterChange();
            this.huidigeArgs = new string[0];
            Label labelGeenProperties = new Label();
            labelGeenProperties.Text = "Geen parameters beschikbaar";
            labelGeenProperties.Width = tableLayoutPanel1.Width;
            this.tableLayoutPanel1.Controls.Add(labelGeenProperties);

            this.actieveFilter = new OudeFotoFilter();
        }

        private void button5_Click(object sender, EventArgs e)//HISTOGRAMFILTER FILTER HIER
        {
            filterChange();
            this.huidigeArgs = new string[0];
            Label labelGeenProperties = new Label();
            labelGeenProperties.Text = "Geen parameters beschikbaar";
            labelGeenProperties.Width = tableLayoutPanel1.Width;
            this.tableLayoutPanel1.Controls.Add(labelGeenProperties);

            this.actieveFilter = new HistogramFilter();
        }

        private void button6_Click(object sender, EventArgs e)//WATERDRUPPEL FILTER SVEN HIER
        {
            filterChange();
            this.huidigeArgs = new string[0];
            Label labelGeenProperties = new Label();
            labelGeenProperties.Text = "Geen parameters beschikbaar";
            labelGeenProperties.Width = tableLayoutPanel1.Width;
            this.tableLayoutPanel1.Controls.Add(labelGeenProperties);
            this.actieveFilter = new Webcam_Filter.Cirkelfilter();

        }

        private void button11_Click(object sender, EventArgs e) //OUDE FILM FILTER ROBIN HIER
        {
            filterChange();
            this.huidigeArgs = new string[1];
           Label labelSepia = new Label();
           labelSepia.Text = "Diepte Sepia";
           labelSepia.Width = this.tableLayoutPanel1.Width;
           this.tableLayoutPanel1.Controls.Add(labelSepia);

            this.huidigeArgs[0] = "1";
            HScrollBar sepiaBar = new HScrollBar();
            sepiaBar.Width = 200;
            sepiaBar.Scroll += new ScrollEventHandler(OudeFilmFilterSepia_Scroll);
            this.tableLayoutPanel1.Controls.Add(sepiaBar);
            sepiaBar.Maximum = 50;

            this.actieveFilter = new OudeFilmFilter();
        }

        void OudeFilmFilterSepia_Scroll(object sender, ScrollEventArgs e)
        {
            this.huidigeArgs[0] = "" + e.NewValue;
        }

        private void button10_Click(object sender, EventArgs e)//BELICHTING FILTER HIER
        {
            filterChange();
            this.huidigeArgs = new string[0];
            Label labelGeenProperties = new Label();
            labelGeenProperties.Text = "Geen parameters beschikbaar";
            labelGeenProperties.Width = tableLayoutPanel1.Width;
            this.tableLayoutPanel1.Controls.Add(labelGeenProperties);

            this.actieveFilter = new Bluescreen();

        }

        private void button9_Click(object sender, EventArgs e)//VERKREUKING FILTER HIER
        {
            filterChange();
            this.huidigeArgs = new string[0];
            Label labelGeenProperties = new Label();
            this.actieveFilter = new LeegFilter();
            labelGeenProperties.Text = "Geen parameters beschikbaar";
            labelGeenProperties.Width = tableLayoutPanel1.Width;
            this.tableLayoutPanel1.Controls.Add(labelGeenProperties);

        }

        private void button7_Click(object sender, EventArgs e)//ZANDLOPER FILTER HIER
        {
            filterChange();
            this.huidigeArgs = new string[0];
            this.actieveFilter = new Visbokaal();
            Label labelGeenProperties = new Label();
            labelGeenProperties.Text = "Geen parameters beschikbaar";
            labelGeenProperties.Width = tableLayoutPanel1.Width;
            this.tableLayoutPanel1.Controls.Add(labelGeenProperties);

        }

        private void button12_Click(object sender, EventArgs e) ///RANDEN
        {
            filterChange();
            this.huidigeArgs = new string[0];
            this.actieveFilter = new Randen();
            Label labelGeenProperties = new Label();
            labelGeenProperties.Text = "Geen parameters beschikbaar";
            labelGeenProperties.Width = tableLayoutPanel1.Width;
            this.tableLayoutPanel1.Controls.Add(labelGeenProperties);

        }

        private void button9_Click_1(object sender, EventArgs e)
        {
            filterChange();
            this.huidigeArgs = new string[0];
            this.actieveFilter = new LeegFilter();
            Label labelGeenProperties = new Label();
            labelGeenProperties.Text = "Geen parameters beschikbaar";
            labelGeenProperties.Width = tableLayoutPanel1.Width;
            this.tableLayoutPanel1.Controls.Add(labelGeenProperties);
        }
    }
}